package com.exam.api.modules.dict.dto;


import com.exam.api.modules.dict.domain.SysDictItem;
import com.exam.api.common.dto.ConverterDTO;
import com.exam.api.common.utils.BeanHelper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;

/**
 *
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString
@Schema(title = "SysDictItemDTO", description = "DTO")
public class SysDictItemDTO implements Serializable, ConverterDTO<SysDictItem> {

    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 主键：
     */
    @Schema(description = "")
    private Long id;
    /**
     * 字典
     */
    @Schema(description = "字典")
    private Long dictId;
    /**
     * 字典文本
     */
    @Schema(description = "字典标签")
    @Length(max = 200, message = "编码长度不能超过200")
    private String dictText;
    /**
     * 字典值
     */
    @Schema(description = "字典值")
    @Length(max = 200, message = "编码长度不能超过200")
    private String dictValue;
    /**
     * 字典描述
     */
    @Schema(description = "字典描述")
    private String dictDesc;
    /**
     * 排序
     */
    @Schema(description = "排序")
    private Integer sort;
    /**
     * 0正常 1停用
     */
    @Schema(description = "字典状态 0正常 1停用")
    private Integer status;

    @Override
    public SysDictItem converter() {
        return BeanHelper.copyProperties(this, SysDictItem.class);
    }
}
